﻿@helper CssLink(string path, string name)
{
    <link rel="stylesheet" type="text/css" href="@string.Format("{0}/{1}", path, name)" />
}

@helper CssLink(string name)
{
    @CssLink("/Content", name)
}

@helper Search()
{
    @System.Web.Optimization.Styles.Render("~/Content/css/search")
}

@helper Autocomplete()
{
    @System.Web.Optimization.Scripts.Render("~/bundles/jqueryui")
    <link href="~/Content/Jquery.UI.AutoComplete.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/bind/jquery.ui.autocomplete.bind.js" type="text/javascript"></script>
}

@helper DatePicker()
{
    @System.Web.Optimization.Scripts.Render(GrainManage.Web.Constant.Script_DatePicker)
}

@helper DateRange()
{
    <script src="~/Plugin/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <style type="text/css">
        span.dateRange input[id][type='datetime'] {
            min-width: 100px;
            max-width: 170px;
            display: inline;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            var dataStartCondition = { startDate: '%y-%M-01 00:00:00', dateFmt: 'yyyy-MM-dd HH:mm:ss', skin: 'whyGreen', highLineWeekDay: true }
            var dateEndCondition = { startDate: '%y-%M-%d %h:%m:%s', dateFmt: 'yyyy-MM-dd HH:mm:ss', skin: 'whyGreen', highLineWeekDay: true };
            $("input#StartTime").focus(function (event) { WdatePicker(dataStartCondition); });
            $("input#EndTime").focus(function (event) { WdatePicker(dateEndCondition); });
        });
    </script>
}

@helper RSA()
{
    @System.Web.Optimization.Scripts.Render(GrainManage.Web.Constant.Script_Rsa)
}

@helper Pagination(string paginator)
{
    switch (paginator)
    {
        case "myPagination":
    <script src="~/Plugin/myPaginationV5.0/js/jquery.myPagination5.0.js" type="text/javascript"></script>
    <script src="~/Scripts/bind/jquery.myPagination5.0.bind.js" type="text/javascript"></script>
            break;
        case "jPaginator":
    <link href="~/Plugin/jpaginator/jPaginator.custom.css" rel="stylesheet" type="text/css" />
    <script src="~/Plugin/jpaginator/jPaginator.min.js" type="text/javascript"></script>
    <script src="~/Scripts/bind/jquery.jPaginator.bind.js" type="text/javascript"></script>
            break;
    }
}